package com.aizhixin.lab.project.template.entity;

import com.aizhixin.lab.project.course.entity.TeacherModuleTask;
import com.aizhixin.lab.project.course.entity.TeacherProjectModule;
import com.aizhixin.lab.project.course.entity.TeacherTaskWorkOrder;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Entity(name = "t_project_role")
public class ProjectRole {
    @Id
    @Column(name = "id")
    private String id;
    @Column(name = "name")
    private String roleName;
    @Column(name = "created_date")
    private Date createdDate;
    @Column(name = "delete_flag")
    private Integer deleteFlag;
    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<ProjectModule> projectModuleList;

    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<ModuleTask> moduleTaskList;

    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<TaskWorkOrder> taskWorkOrderList;

    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<TeacherProjectModule> teacherProjectModuleList;

    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<TeacherModuleTask> teacherModuleTasks;

    @ManyToMany(mappedBy = "projectRoleList",fetch = FetchType.LAZY)
    @JsonIgnoreProperties(value = { "projectRoleList" })
    private List<TeacherTaskWorkOrder> teacherTaskWorkOrderList;
}
